import { Request, Response } from 'express';

export default {
  'POST /sys/login': (req: Request, rep: Response) => {
    const { userName, password } = req.body;
    if (userName === 'admin' && password === 'admin') {
      rep.send({
        status: 'ok',
        token: '34234safdsa4354sdaf#$Ssfds56',
        currentAuthority: 'admin',
      });
      return;
    }
    rep.send({
      status: 'error',
      currentAuthority: 'guest',
    });
  },
};
